Small bug fixed and major optimization update.