Fixed conditions bug