Some declaration_static fixes from NQP repo.