Merge pull request #5036 from rahku/fixes