Added master gain and other minor stuff.