Fix #494

Fix #494 by ignoring directories for which we do not have execute permission.