Bugs fixes and efficiency fixes
Merge remote-tracking branch 'origin/Kyle'