Small modifications to make the code nicer.