Actually didn't fix the bug, it was related to how I get the output directory from the input filename. Added text halo as well.