Fixed variable naming in inverse function.