Made some small refactorings and fixes to finish binding package.