Fix script to work with new library code