Fixed: KeyError/ValueError on generating context output. (close #21, close #22, close #23)