Added checks for variable dependencies