Number comparison unit tests and bugfixes