Improve backtracking call to append/3.

Thanks pmoura for the suggestion!