fix bug where skipped files were mistakenly being added to the context as empty elements