Nested conditional statements causing conflict.