Fixed a few bugs with filter, fixed restul delete

Please note this will now only work with new database format.