Bug fixes and graph improvements