Add CMAKE_DL_LIBS to link command.
Fix a problem with the new array bounds check code.