Return statement error-checking