fixed mainFile resolve bug

changed 2 .map()'s to forEach()
added 2 debug fields
small cosmetic changes