Fixed get_basename method to include T_init