Fixed some bugs to get all rawfiles in DB by copying metadata object