Bug fixes and CASTs