Merge from upstream; bump version to 0.5.0