Made some type changes to avoid warnings, etc.

Many of these changes don't make a difference, as I'm more or less using generic memory to manipulate bits in many cases, but these are better practices to use in general.

first commit using clion ide.