fix #899 #948 #788

will go into CRAB_2_9_2_patch1