Fixed type casting issues. Now delays larger than 32s are working.