Fixed warnings and removed some commented out code