Issue #5 tests and small fixes