Fix unreachable return & simplify some branches.