Scrutinizer picked up on 3 minor bugs and one bug that would have broken things.
Scrutinizer FTW. Worth every penny!
Signed-off-by:Joshua Dickerson <joshua.a.dickerson@gmail.com>