Added check for directories when compiling multiple files.