Typo + code corrections/improvements

See the diffs for further information.