Changed swap check code to be more robust, theoretically it is working now.