Updated Rewrite scripts QBAL