Fixed some bugs and implemented the method TiObj::loadStream