Fix #3954 -d works as expected now