Fix deletion of not yet borrowed materials

closes #455