Fixed a bug introduced by performance improvement