Improvements to context parser