Converted UINT to INT where necessary