Finishing touches on reference generation script, fixes #113