minor-fixes-and-type-safety-improvements (#22)