More codereview changes as suggested by timgraham