Minor performance improvements and adding todo warning.