Tidying up a little bit
Fix unit tests