more of Du's bug fixes