Backport changes from `0.4` version