src: Fix error handling.