more fixes to invalid IDs - close #704