Issue 61

Fix issue #61 + tests for the fix.