Fix a couple bugs involving extraneous newlines

Change-Id: I895975f9863b5d19fb54383594a0fffbf8834271