Fixed some more minor bugs and added visual-test