Fix namespace management