fix bugs reported in TFS 1536605