Test improved, some bug fixes during the testing.