Revert pull requests #530 and #607

The gating test job on master is currently broken, and let through two broken pull requests. This branch reverts those landings to restore head to a buildable state.