Fixed warnings and 64-bit issues.