Fixing 2 bugs. 

Make sure we use the unique if file or titleFile are null, and don't increment it for titleFile.