fixed API flaw, unit tests passing
fix bug using the wrong arg for setType