Bug fixes and algebra example