Sync changes from 0.3.4b master branch