Correct and improve {get/make/set}context routines