Corrected -d handling