Fixed issues #83, #84, #85