fixed tests and functionality [by alnaav]