Fixed null handling