Fix const-related warnings on convenience_ctx()