Seebs/warning fixes

This is a handful of fixes to remove warnings being generated by clang. I think at least a couple of these were serious bugs that could break code badly on some platforms (such as anything where size_t isn't the same size as unsigned int). Mostly just trying to reduce the spam so that warnings are actually significant.