Replaced the rest of the x.constructor != String comparions with typeof (Thanks Kelvin)