a few more fixes/changes based on comments from @ohadlevy