Add autoinit support and check if already inited