Fix #28 and #103