added some error checking on ep0 writes