Reworked unit ID's. Implemented handling of unreachable goals.