Fixed issues with valgrind reporting uninitialized bytes