Fix #40 and add missing documentation