Cleaned up main, fixed the not-running-as-root bug.