Manual merge of #475. Closes #475