Fixes bug with ghost layer