Bugfixes in graphics implementation (still not working through)