Fixed bugs with variable dependency.