Remove unused stuff
Add some sanity checking in the parsers