Fixed bug that would return all values as undefined