Fixed yet another problem with chained conditionals