Fixed test setup and added new test functions