minor cleanups and replaced my earlier fixes: removed 'auto' and return in trim()