Sync with upstream 0.5.0