Some changes for running in QE env. Code cleanup.
Some changes to the tests for the QE env.
Changing tests for the QE env.