Fixed testing

Also fixes cocktail sort, adds some extra checks when setting the list,
some other bug fixes etc