Fixing minor bugs in operation.sql script