Fix some warnings and other issues.