Improved validation checking for map key empty