Fix bug in pyramid