Merge #485 by hand