Add javadoc, exceptions.