Fix source file detection