fixes for @lindahua's comments