Cleanup nil handling