Simplified code in simplify expression samples
Added defensive code against extended operands in simplify expression refactoring