Fix statics being reset to undefined