Switch from tabs to spaces and a few tidy ups