Fixed BaseAlgorithm bug