Fixing unreliable tests