Merge "Cleaning up set_contexts_on_border function."