Fix bug in ata.c