Added null checks to parsing methods.