Fixing self_encoder