Fixed minor and major bugs

Fixed a major "erratic .fil file" bug, where this file was sometimes transposed.
Fixed some minor issues.