three hacks to workaround bug 1038