Some bug fixes and visualization