Fixed errors when type not found

Fixed encoder errors when type not found