fixes as per comments