Fix error handlings for put/remove