few fixes and some new bugs