bugfix

solved some small but important bugs