fix bug #111
fix bug #112
fix bug #115
fix bug #116