Fixed parser and added more tests