fixes #2614
fixed oldvalue assignment
some editings
enhanced test method