fixed #76 > proper error message when 'type' is undefined