Make Magic_Str() function as an integer, where possible