Fix getting timeout from Context (close #1282)