fixed bubble sort spec
added occurs check in the pattern matcher