Fixed warnings and cleaned up.