Improvements

Various improvements, see #3 for discussion.