bug fixes and added to context.py