Fix #107 and #108