Minor bugs with use of object.keys & __dirname