Various bugfixes

Fixes for: 
#3482
#2469
#3928
#3863
#3769
Should be good to merge after you fix this.