Fix #41 and #42