Fixes for #2

A series of minor fixes for #2.