Optimizations, minor corrections.