Various bugfixes

Fixes for: 
#3482
#2469
#3928
#3863
#3769
Could you explain this change?