Add missing return statements in error paths