Fix bug when function is static and primitive at the same time
Remove EMIT_LEAN_CODE check