Fixed conditional. Ties now work correctly.