Corrected some valgrind issues

 * fixed several uninitialized variable issues
 * fixed possible memory corruption in CEngine