fixes for itai's code review