Fix remove operation bug. Add some warning logs.

Tiny fix of remove.