fixed bugs (added unit tests) in qty.inverse() and qty.to(inverse)