Implement deprecated (msvc), fix test compile (msvc), make casts explicit.