Fix some issues and add nl to the end of all files