added some tests and fixed a typo