Improve error handling for the bind functions.