fixes #1163 fixes #1160 fixes #1129