Fixed warnings and minor cleanups.