Small fixes: 500 errors based from user queries, allow local datastore access

Three independent small fixes, one per commit, so I'm not creating issues for each one (hope that's acceptable)