Added parser tests, fixes some issues