Added (failing) test for #954
Added possible fix for #954 but waiting for changes to the typechecker