fixing some bugs found by test team