Check for undefined to resolve #173
Merge pull request #175 from blittle/master

Check for undefined to resolve #173