Rename library entry point and clean up some code.