Fixing errors, cleaning controller