Moved things around to allow slightly nicer ini reading for standalone scripts.