Fixed some issues when compiling on 64-bit system