Moved print after unbuffering stdout.