Fixed a bug, added backwards compatibility for building, did some speed optimizations

Hello,
now I got it working, the attached version runs.
Bugfix: 0e6f6e4e483bf400ec9fb87dd3971a7d68420b9f
Backwards compatibility for building: d5c719d431070b23cec0e75e7f3a74f4ffc5d7fb