Replaced all silent NULL pointer checks for invalid data with assertions.