Simplify getKindAndID, add tests for invalid cases