fixed NPE on offset/size/total
cleanup imports