some fixes from bruce