Add cropping & splitting. Also fix some bugs