Fixing withtype clauses