Detect bug earlier with type casting