Fix parsing of empty strings. Add more tests