Put macros at top to keep the byte-compiler happy
Merge pull request #60 from shosti/fix_tests

Fix some intermittent test failures