fix egregious expansion bugs