Fix several long standing issue in the backend