refs and fixes #2995 #2784 #2932 #1797 #2980 #2994