Fix warnings in library (tests can wait)

After adding -Wall to CFLAGS/CXXFLAGS, the build output is a lot messier, and this needs to be fixed. So lets get crackin on that :u