sdlog2 performance increased, fixes and cleanup