Libchula buffer.c fixes