Added proper undefined check to prevent possible errors
console.warn instead of console.error
Merge pull request #1 from jkarsrud/proper-undefined-checks

Proper undefined checks