Fixed the issue in the library instance constructor calling sequence