Initial Bugfixes to import from Esohead