Fix list null pointer handling