Fix issue #57, additial complications with character and factor types are fixed
merge conflict solved