Refactor; allow specifying a version; better errors.