Fixed some bug

There was clearly some bugs...