Fix issues raised during code review and some other old friends