Correct code from merge with original fork