Fixes #5023
Fixes #4643
Fixes #5061
Fixes #5035
Fixes #4940
Merge pull request #5081 from Zuhayr/master

Small fixes.