Less memory clobbering and proper initialization