Updated fix to work with the new changes from Martin