Fixed the bugs in the local file source helper.