Fix a minor bug. Make the code a little bit simpler to read