Fixed middle layer bug