a few fixes and some cosmetics