Replace some gotos that lead to single return statements by direct return.