Code review fixes

Thanks to @thecodejunkie