Fixing type checking