Reapply lost changes

This reverts commit 21aef622eb089a043090c82d887108b14e169ff5.