Added 5 tests and fixed a bug in the process!