Fix various issues per code review