Pietro fixes

several small fixes ordered by Mr. @pietrogregorini