add a few typeasserts for additional clarity

unnecessary changes, but protects against malformed XPaths