Revert pull requests #530 and #607

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