save userdata, fix minor bugs