fix bug #96 #105

#96 #105  <https://github.com/aui/tmodjs/issues/48>