Bug fix for indexed variables