Fix bug with incompatible type non-const type