Make sure getID() does not cause a notice in some weird situations.
Added test and explanation for types.