Fixed edit functionality. Made some previous changes that broke it, but it seems to be working now. Also changed some hard-coded strings to static variables.