Use LENGTH macro everywhere
Fix support for OpenCL 1.0