#11 Various bug fixes for 64bit

#11 fixed. Addressed various bugs that prevented 64 bit from working
correctly.