On the reliability of N-body simulations