Improve error checking when importing callables