Fix shell and bubble sorting to use callbacks