Altered code syntax to match Valgrind suggestions.