Multi arch support

This pull requests fixes issues related to multiarch support such as problems with 32/64 bit types