Fixed potential NPEs and also formatted according to 120 characters per
line