Fix more bugs around delete and an error message.