Merge fixes from master branch