Fix bugs, add xbel exporting