Added useful errors to index.js