Fixed patch application issue going over bounds