Fix minor problems and build for linux on 386