correct the number of bound variables