Applied small optimizations

Fixed inconsistent definitions