updated tests, added some type checks