Parser should be more robust. I also added some tests to check that.