Some of my conditional logic has suddenly stopped working