Fixed build; fixed out-of-bound test cases