Fix offline mode bugs