Fixed a number of Warnings

May cause issues in VC++ 2008 due to increased type knowlage required by UNUSED