Added nil context handling.