Table calculating fix