some fixes by Shlomi