General fixing and cleanup.