Removed x flag
Added valgrind and cuda-memcheck tests for memory leaks