Fixed some bugs with context size.