8-puzzle bug fixes