Fixed missing return statements