Merged #77 and #79