Fix style and error management.