Good pickup! I've fixed it now.

As for nano, control + x, then y and then enter will save your changes and then close the file.