Fixed a few little errors, added a test file