Cherry Pick Upstream Changes

Several package changes have been made since v0.5.0. Merge in cherry
picked changes so the package can stay as close as possible.