Fixed issues discussed in #713