Add 64bit support for the library
Fix type issue