Minor tweaks to rate limiting, adding a test