index.js: Added return so as to not continue after encountering an error
parser.js: Added test case and corrected types of