Add some tests and QA