Rewrote flush commands with shellquote per suggestion of aellert