Cast and fixes