Fix some issues that will allow all tests in models folder to run as a batch.