minor fixes for nil corner cases.