Improve contact test