fixes a low level error;
adds test cases for types; #15