Fix Andrew hull algo and add test