Revert previous patches due to bug