Strip final newlines