fix early 'return' typo, a few other small fixes