Fix state_remove() in regard to key