Fixed more errors related to #785