Fix deleting from db and index for editions.
Adding Query to error output for database statement.
Merge from master