Bugfix 64 bit pointer arithemtic
bug fixes and warnings removed