Improved handling of numeric types in comparisons and equality testing.
Removed unused code.