Fix errors based on Masao's comments