fix(lib/throttle): fix bugs, add tests