Added a bit of package name validation

Also cleaned up a bit of indentation that was wrong in my last commit. I don't think that is enough for a separate pull request.