Fix build and some other stuff brought up in code review