Various updates, fixes, and better export