I think if we set the default offset to 0 instead of null we can avoid the if and isset below.

You will also need to update the compile function below.