Fixed database errors. Timestamp MUST be of type long.