Reverse update from commit #374 because it appeared to be causing major side effects.