Minor improvements (close #1001)