fixes #1016 #1045 #1046 #1929