This patch fixes all errors that failed the tests