miscellaneous style fixes, including cppcheck warnings, changing post-increments to pre-increments, changing (*i). to i->, and checking for empty objects using empty() rather than size()