Fixed minor bug, lots of speedups, more testing