Fixed error handling in kernel execution. Removed of obsolete
stringstreams and saved some space in program code.