Remove debug logging + add "type" param to errors

ref #7