Bug fix in inner_product implementation