Fix bugs to pass the first sample code.