Fix null pointer, add start offset