Fixed compiler warnings due to numeric constants and uninitialized variables; added more robust CL device selection