Warning fixes

Mostly a few type conversions, also a link problem on x64 (not sure why only on x64?) for unittest.

-[Unknown]