Did you received one of following errors in Sharepoint?
The DataSourceID of 'TopNavigationMenu' must be the ID of a control of type IHierarchicalDataSource. A control with ID 'topSiteMap' could not be found.
Exception message: The DataSourceID of 'QuickLaunchMenu' must be the ID of a control of type IHierarchicalDataSource. A control with ID 'QuickLaunchSiteMap' could not be found.
As You propably already find out.. this error is very likely to have nothing in common with masterpages or layouts..
In my case error occured immediately after adding my custom navigation provider to web.config (without even using it!)
What was wrong? Assembly in which was provider was signed and I was not using full assembly string in web.config. Argh.. sometimes I hate sharepoint..
(beside that SafeControl entry is of course also needed)
If above solution does not work in your case try googling more.. a couple of other things causes above errors to appear.