Fixed a bug in populate