Add cast to key_t and comment