Infrastructure improvements. Closes #382