[FIX] Typo, and do some optimizations