Wrote some unit tests, trying to catch some edge cases