Fixed Valgrind errors: Conditional jump or move depends on uninitialised value(s)