Fix #766 - GD detection