Fixed missing breaks and added missing return statement