More code optimizations. Thanks kpfleming!