inline a couple of calls, misc optimizations
fix typos
more typos...