1.5b2 fixes

fixed #1039, #1038, #1040.