Removing (optional) semicolons at the end of queries