Add exists_and_is_file and exists_and_isdir methods