Clean before building in debug script

This bit me just now.
Add support for casts