some fixes according to code review comments