Bug fixes

Fixed the return type checking bug