Algorithm corrections