Bug fix; enforce non-null buffer context