Fixed the second issue from #566.