Fixed conversion warnings and VS 2012 error.