Fixed return type checking