Various optimizations, additions, etc.