Fixed pie legend display bug in chrome, lots of cleanup