Reverted type casting and adapted test case