Tests

Worked on some tests and fixed a bug with search