Fix query error when saving tax rates

Fixes #6202