bug fixes, added better tests
version