Removed valgrind invalid read