Improved style and removed warnings.