Some fixes plus documentation