some bug-fixes