File mode changes + Small Bugfixes @ code