changes equivalent to patches from https://github.com/ssrini/scalr