Fix remaining permissions issues and crashes.

This fixes #172 and #150, and it also addresses all of the forum error emails I've seen up until now.