Casts key to avoid implicit conversion error on const