More fixes for #11. Fixed algorithm environment