Hoping this fixes tests in setup.py
Added initial tests and fixed discovered bugs.