Fix style issues (and one bug) spotted by lioncash.