Various improvements to the backend.