Various code cleanups

Just fixing some minor stuff in various places in the source.