Fixed issues in test code (fixes #3)