Improve handling of static member variables and functions