Fixed errors and some warnings on the VS2013.