Fixes from master

This PR contains only fixes which were committed to master.