Fix issue/edge-case with ctx objects being null