Added more tests, foreach compability