Update latest code from master branch before 0.5.0 release