Fixed few optimization
Merge pull request #24 from Xety/optimization

Fixed few optimization