Cleanup, bugfixes, syntax test improvements