fixed unit and functional tests for Issue #613

Fixed two unit tests and ~35 functests for last minute modification in  PR #613 


Fixed in ba2ce6e