Fixed bug that completely broke refactoring in the viewer.