Removing a few warnings and code smells