Fix for copying metadata flags

Only became apparent when tests ran on a BSD based system.