Docuemntation and fixes