Patch to fix 1.6 build problems - thanks Kev