fix bug in statev script for empty contexts