Now checks __name__ so it only runs directly.