Fixed nextContextUrl for null cases.