Fixed main bug in GTE and minor corrections.