Fixed bug in BaseAlgorithm constructor