Fix fatal error when there is no context