added new contextRequirements support
fixes for bugs found during testing