[BUG #7273] Fixed unit tests
[BUG #7273] Fixed overflow handling
[BUG #7273] removed obsolete code