Include the latest fixes from 6.0 branch (6.0.4 and a few more fixes) into the next and master version.