fixes and func tests