Fix #121 and #95