Fixed some bugs. Added filePath in order to report errors more accordingly