Fixed minor warnings and unused code