Fixed undefined/null issues
Preparations for release 1.0.0.