Fix permissions and clean up.