bug fix in layer bounds computation