Corrected issues from peer review

- Replaced calls to process.cwd()
- Added missing return calls