Fixed bug in function that prints internal state.