Fix multiple bugs 2.