Immutability tests. Some fixes. Metrics implementation.