fix minimal bugs