Corrects bugs. Implements preferences.