Removed unused var definitions.
Fixed bug in uchar_clamp() (aka to_uchar())) which didn't clamp correctly.