Thanks for pointing this issue out.
User group privileges is the newest feature to be added to the library so has not gone through that same level of testing as most other features.
I've fixed the bug as you outlined yourself and have push it to the Github repo with a credit in your name.