replace malloc with calloc

(in a setupBuffers)
change order in setupCl
setupCL -> clean
cleaner error checks in main