Bug fix
Optimization