Series of fixes