Filemanager: add some sanity checks before copying