fixed toInt(), toReal(), toString()

@jxwuyi 
Small fix to the type signature. 
Previous toInt would disallow user declared types.