Add some debugging statements to layer/models.py