fix small bugs that are found in issue #579

#579

This PR makes the issue 579's workflow clearer.