Fixing return code