correct various small bugs