Fixed algorithms in some methods