Fixed text render error and added test