Import patches from the master branch which prevent seg-faults when parsing