more fixes and improvings