Bug fixes and file streamlining