Some fixes, better documentation, etc.