Better handling od directories in test