Fix string refcounting in context.c

adds missing fixes in context.c