fix and improve context test