this looks correct but two things would help:

1) Document why "/" is prefixed to the keypath in a comment
2) A few unit tests wouldn't hurt.