Undid merge of upstream source, which caused incompatibilities, re-added complex math code which now fully works.
Merge branch 'master' into fixed - as you can probably guess, the master is broken, so this "ours" merge is being done to get rid of it