Move test code around (issue #75)
Bugfix for issue #75