Fix #11 and #112