Not sure that `uint16_t` in the API is the best idea — IMO `int` or `unsigned int` are better. But that's a nitpick, for sure.