Cleaned up
Added more tests for the low level implementations.