Fix bug and update with output functions.
Fix bug and update with output functions.

sruesch/relic,OlegHahm/relic,ace0/relic,sruesch/relic,ukscone/relic,ukscone/relic,ace0/relic,tfar/relic,tfar/relic,OlegHahm/relic,ace0/relic,ace0/relic,sruesch/relic,tfar/relic,ukscone/relic,OlegHahm/relic