Small error fix, further performance improvements