Fix bugs caused by reorg/rename