Fixed return statement and tests