Implement option getters and improve error reporting when parsing options.