Improvements/fixes for context