Fixed a typo
Made it check for output directory
Always add the header to outputed style