Revert "Apply patch from trac #133" as it broke the build

This reverts commit 529e2a6595f539807f2e4bfaa378890c4e965e1e.