Updated for bugs on github