May produce NPE
Merge pull request #106 from stliu/NPE

May produce NPE