Fixed a few bugs. Removed dependency on scala default settings.