Add tests, syntax fixes