Fixed coverity problems