Bug/1146167

Feel free to squash the changes, but I have the commits divided into steps as necessary.