Fix error return value type