Do not write the removed folder on the DB

Should fix #1329