Bug fixing & optimization