Fixes #3125
Fixes #2957
Fixes #3052
Fixes #2740
Fixes #3131
Merge pull request #3129 from Zuhayr/master

Various fixes.