IE8 fixes, when string isn't string

This kept bugging me on IE8. I kept getting error that there is no such function. Found out little fix for it, Hope it will help others too