Fixed a bug with "undefined" values