Prevent out-of-bounds access into mapnames array.