Updating library

Some code fixes so that it works with the newest library commit.