Added tests for #143 fix