FIX: type error detection