Some improvements to the backend