Merged #17
Partial merge of #19