Added tests for issue 32 and fix for it