Fix error in dict access for nonexistent lines