Manually copying pull request from dslab-epfl