Fix SAM type coercion of traits