Added error check for string C problems

Signed-off-by: Ionut Radu <ihonius@gmail.com>