Fixes, tests, and removed unnecessary files