Safer implementation of get_halfs