Minor cleanups (bug #1618 included)