Small fixes, added documentation (sometimes even PEP-compliant)