Added parser spec tests, fixed segfaults