Fix (de)selecting directories in file list

So much horrible code... But I found some trailing spaces!