[Delivers #83678858] Refactor to return its own class

Also fixes bug on vertex ID zero.