fix some assertion issues #1