Replaced assignments with swaps; Fixed compilation error; misc.