Simplify some expressions

Hi,

these patches simplify two expressions, please review and test them (expecially the second patch).

Kind regards.