Added selection sort and fixed minor bug.