Fixed return code checking.