Fix some refactoring tes stability issues by ensuring projects are built before attempting a refactoring.