Cleaned up function emitting.