Some bugfixes. Now deletion doesn't work.