This fixes #1311, thanks @bartvde!