Backport of 902e763232b023dc0892d119c510d38449b6bd2d (Fix for bad data inserted as a result of being called with an incorrect typeId)
Merge branch 'release/2.1'

Conflicts:
	db/src/main/java/com/psddev/dari/db/MetricAccess.java

This is a merge of a backport; the incoming changes have been ignored.