some polishing and bug fixes