Unit tests and small updates

Almost all graphic classes have unit tests now. Also fixed a couple of
things here and there.