Tweaking the code to address new filepath issue.
Fixing error issues.