Fix: bug in extend_tsf near 0x8000000 values

Bugfix + added more test cases.