same changes related to #2259
fix #2171
fix #1900
some commented code to handle #2296
fix #2193