Fix warnings and clean up.