Mac fixes

Just added a few newlines that were missing, which was keeping it from compiling on my mac. There are a few other things as well, which are detailed in the commit messages.