Implementing issues #25 and #7.