Fix for #16 and #17

Added another if-condition to avoid ' a float is required' type error and added check if 'date' field of result is tuple to replace it with the first tuple value to avoid 'expected string or Unicode, tuple found' type error.