I'm getting:
"This item cannot be deleted because it is still referenced by other pages."
When I try to delete a master page or a page layout. All the pages that were made with those are now gone.
The solution is to create a sub folder in Sharepoint designer (SPD), move the master pages or page layouts that you want to delete in it, and then delete the sub folder. Thanks to http://www.jamik.de/news.php?item.48