Fix bugs introduced