fixed caller depth
added decode_utf8()
changed script function
added template functions