Several fixes as per review