Dewey avoids Chapter 7 bankruptcy after agreeing $50m settlement