fixes to api/buffer.c(squash into @efa9d44c)
fixes to api/helpers(squash into @d61d851)
fixes to api/window.c (squash into @0265e60)
fixes to main.c (squash into @7c90700e)
fixes to provider.c (squash into @f8ef29be)