adding more tests and minor fixes