Some minor changes to the code