Fix various issues.