I think the developer should own the code but the client should also be given all rights to use, copy, distribute, resell, or both parties could be given exclusive rights.
And then there is the matter of by-products which are pieces of code you develop during your contract time but not necessarily used within that project because somewhere along the line you've discovered that it is something you can use elsewhere and does not make much use for that specific project.
Who owns those? From your contract's perspective, the client owns them and you are obliged to deliver them whether or not they end up in the final product.
I'm not trying to be dismissive of your lawyer's knowledge in the area, and neither am I a lawyer, but I think it is kind of hard to write down a standard contract that can be applicable to all projects. Contracts should be negotiable and license/IP is something as negotiable as the contract fee. And your contract sounds too protective of the client at your cost.