Fix testing and add static func definitions where appropriate