Remove unused methods and avoid generating and expanding non-zero dereferences when possible.