Fixed some small bugs. Return of compatibility with GUI.