fixed segmentation fault in case typeStartToken() returns 0