Add better error handling for bindings