Fixes bug in _nl_getLayers.