Minor bug fixes on #1699