fixes as per Chris code review