Add logging for TypeMapping and a little cleanup