Fixes from using gcc 4.7.3

I'm using Ubuntu 13.04 which ships with gcc 4.7.3.  In working with my own test application I found various compiler errors (e.g. the dependent header commit) and warnings.   I also included one bit of code cleanup.  
Please see the commits for comments on why the changes were made.

I also have a couple issues which I will be posting to JIRA.

Thanks!