Tests, bug fixes, todo