Fixed an egregious bug, style improvements.