Added the CopyStatusFlags routine