Fixed issues #110, #111, #112