Fix some issues when reading from nonexistent items.