Fixups

Few small fixes. See individual commits for descriptions.