Null pointer fix and additional parser checks