Fixed some warnings, general cleanup