Fix build and detected key type.