Fixin' null ref, deletin' dead code