Miscellaneous code review fixes