Dev/davide di carlo/fix bugs

Some bugs fixed