Issue #166 Several fixes to test code.