Various code review fixes