Cg error type correctness fix, diag logging on error

Type correctness for CGError/CGerror, and logging that may prove useful with shader errors in the future.