first set of bug fixes raised by ramzy