fixes #1122 #1118 #1102