A couple of updates

Bringing the library up-to-date and fixing some corner-cases that I've encountered