Fix warnings
Fix type for dimension assertion
Fix warning and add success message to ag