Fixing a problem reported by bauer

This fixes a problem reported by bauer in
http://fabrikar.com/forums/index.php?threads/came-across-2-errors-after-latest-github-update.35405/.

I have not tested this change.
Better fix.
Merge pull request #903 from Sophist-UK/bauers_fixes

Bauers fixes