Small fixes
Code optimization