Fix graphite bugs