Fix a couple of bugs in Analysis