Fix more one-off bugs

Trilateration seems to work now.