Added several cases for critical XS bugs

Added several cases for bugs, including access outside bounds.