fixing issues outlined by Seb's code review