Making query_by_timestamp return None if no suitable object was found.