Improve parser robustness

#12