Fixed sdivUB helper function and added test case