Clean up variable declarations; switch to strncpy from strcpy