Fixes a problem with deserialization throwing a RuntimeExecption when
called on isEmpty or size by enlarging the code wrapped in try...catch.
Fixes typo.
Fixes problems with mismatch between preferences and database.
Fixes bug with reading intervals being closed by user inactivity.

Refs #23