Update test + fix some bugs