fixed restype table. changed type field to restype