fixes for #43 based on @jdalton's feedback