Fixed a bug in lib init