Started unit tests and fixed issue with crash when smaller than one pixel scale.