Added threading, fixed reflection errors, other things