Updating tests and reformatting code