Some fixes and documentation