Fixed bug where null values would cause an error.