fix out of bound memory access

lots of stabilization
fix dimension bugs, and mark_path()
add flags for warning/status messages