Better handling of data when offline, closes #45 and closes #46