Removed duplication in output directory creation;  
Fixed missing error checking;  
Revised FIXMEs and TODOs