Fixing a type check