fixes from mptei. THX!