a few more coding style cleanups and one bug fix (from AnthonyL)