Check for TypeError and ValueError when scanning

Python 3 throws an exception when sorting a list of unorderable types. In
Python 2 that we might get past that point but when extracting values from
a callback tuple it might not have enough values.