Replaced implicit pointer->bool conversion by explicit != NULL comparison