fixes from Thomas to remove unwanted elements