Merged lost changes from branch 1.8.5